/*
 * Copyright (c) 2017 Open. All rights reserved.
 * @(#) SignUpForm.java 2017-07-14 00:31
 */

package com.laf.LAF.domain.user;

import com.google.common.base.MoreObjects;
import com.laf.LAF.domain.captcha.CaptchaForm;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author WuGang
 * @since 1.0
 */
@Data
public class SignUpForm implements CaptchaForm, UserForm {

    private static final long serialVersionUID = 3169892303146515191L;

    @NotNull(message = "请输入密码")
    private String password;
    @NotNull(message = "请输入确认密码")
    private String confirmPassword;
    @NotNull(message = "请输入手机号")
    private String mobile;
    @NotNull(message = "请输入验证码")
    private String captcha;
    private String imei;
    private String os;

    @Override
    public String validate() {
   /*     if (!Validators.isChinaMobileNO(mobile)) {
            return "请填写正确的手机号";
        }
        if (!password.equals(confirmPassword)) {
            return "密码和确认密码不匹配";
        }*/
        return null;
    }

  /*  @Override
    public CaptchaType getType() {
        return CaptchaType.SIGN_UP;
    }*/

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("password", password)
                .add("confirmPassword", confirmPassword)
                .add("mobile", mobile)
                .add("captcha", captcha)
                .toString();
    }
}
